# Maintainer: Lukas Fleischer <lfleischer@archlinux.org>
# Contributor: Loui Chang <louipc dot ist at gmail company>
# Contributor: Geoffroy Carrier <geoffroy.carrier@koon.fr>
# Contributor: Nathan Jones <nathanj@insightbb.com>

pkgname=tig
pkgver=2.5.8
pkgrel=1
pkgdesc='Text-mode interface for Git.'
depends=('git' 'ncurses')
makedepends=('asciidoc' 'xmlto')
url='https://jonas.github.io/tig/'
license=('GPL')
arch=('loong64' 'x86_64')
backup=('etc/tigrc')
source=("https://github.com/jonas/$pkgname/releases/download/$pkgname-$pkgver/$pkgname-$pkgver.tar.gz")
md5sums=('a91a2ff16778fe173ddf94a92f3c3a0e')
sha256sums=('b70e0a42aed74a4a3990ccfe35262305917175e3164330c0889bd70580406391')

build() {
  cd "$srcdir/$pkgname-$pkgver"

  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc
  make
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  make DESTDIR="$pkgdir" install install-doc-man

  install -Dm0644 contrib/tig-completion.bash "$pkgdir/usr/share/bash-completion/completions/tig"
}
